<?php
foreach ($modules as $c) {
    ?>
    <tr>
        <td class="tal">
            <?php
            if ($c ['cldcount'] > 0) {
                ?>
                <img src="../../../css/manage/style/images/colum1nx2.gif">&nbsp;&nbsp;
            <?php
            }
            ?>
            <?php echo $c['category']; ?></td>
        <td class="tac"><?php echo $this->getModuleName($c['module']); ?></td>
        <td class="tac"><input type="text" class="small validate[required,custom[integer]] "
                               name="seq_<?php echo $c['module_id']; ?>"
                               value="<?php echo $c['seq']; ?>"/></td>
        <?php
        if ($this->actExist('Del,Edit')) {
            ?>
            <td class="tac">
            <?php
            if ($this->actExist('Edit')) {
                ?>
                <button class="btn" onclick="showedit(<?php echo $c['module_id']; ?>)">编辑
                </button>&nbsp;&nbsp;
            <?php
            }
            if ($this->actExist('Del')) {
                ?>
                <button class="btn" onclick="del(<?php echo $c['module_id']; ?>)">删除</button></td>
            <?php
            }
        }
        ?>

    </tr>
    <?php
    if ($c ['cldcount'] > 0) {
        foreach ($c ['childs'] as $cld) {
            ?>
            <tr>
                <td class="tal">
                    <?php
                    if ($cld ['cldcount'] > 0) {
                        ?>
                        <img src="../../../css/manage/style/images/bg_columnx.gif"
                             class="lineicon">&nbsp;&nbsp;<img
                            src="../../../css/manage/style/images/colum1nx2.gif">&nbsp;&nbsp;
                    <?php
                    } else {
                        ?>
                        <img src="../../../css/manage/style/images/bg_columnx.gif"
                             class="lineicon">&nbsp;&nbsp;
                    <?php
                    }
                    ?>
                    <?php echo $cld['category']; ?></td>
                <td class="tac"><?php echo $this->getModuleName($cld['module']); ?></td>
                <td class="tac">
                    <input type="text" class="small validate[required,custom[integer]] "
                           name="seq_<?php echo $cld['module_id']; ?>"
                           value="<?php echo $cld['seq']; ?>"/>
                </td>

                <?php
                if ($this->actExist('Del,Edit')) {
                    ?>
                    <td class="tac">
                    <?php
                    if ($this->actExist('Edit')) {
                        ?>
                        <button class="btn" onclick="showedit(<?php echo $cld['module_id']; ?>)">
                            编辑
                        </button>&nbsp;&nbsp;
                    <?php
                    }
                    if ($this->actExist('Del')) {
                        ?>
                        <button class="btn" onclick="del(<?php echo $cld['module_id']; ?>)">删除
                        </button></td>
                    <?php
                    }
                }
                ?>


            </tr>
            <?php
            if ($cld ['cldcount'] > 0) {
                foreach ($cld ['childs'] as $lastcld) {
                    ?>
                    <tr>
                        <td class="tal"><img
                                src="../../../css/manage/style/images/bg_column1.gif"
                                class="lineicon2">&nbsp;&nbsp;
                            <?php echo $lastcld['category']; ?>
                        </td>
                        <td class="tac"><?php echo $this->getModuleName($lastcld['module']); ?></td>
                        <td class="tac">
                            <input type="text" class="small validate[required,custom[integer]] "
                                   name="seq_<?php echo $lastcld['module_id']; ?>"
                                   value="<?php echo $lastcld['seq']; ?>"/>
                        </td>

                        <?php
                        if ($this->actExist('Del,Edit')) {
                            ?>
                            <td class="tac">
                            <?php
                            if ($this->actExist('Edit')) {
                                ?>
                                <button class="btn"
                                        onclick="showedit(<?php echo $lastcld['module_id']; ?>)">编辑
                                </button>&nbsp;&nbsp;
                            <?php
                            }
                            if ($this->actExist('Del')) {
                                ?>
                                <button class="btn"
                                        onclick="del(<?php echo $lastcld['module_id']; ?>)">删除
                                </button></td>
                            <?php
                            }
                        }
                        ?>

                    </tr>
                <?php
                }
            }
        }
    }
}
?>